<?php

class Admin_Model_Activity
{
	private $_activityId;
	private $_userName;
	private $_activityDescription;
	private $_moduleName;
	private $_activityDate;
	private $_userBrowser;
	private $_userIp;
	
	public function __construct(array $options = null){
		if (is_array($options)){
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value){
		$method = 'set' . $name;
		
		if (('mapper' == $name)  || !method_exists($this, $method)){
			throw new Exception('Invalid Activity property');
		}
		
		$this->$method($value);
	}
	
	public function __get($name){
		$method = 'get' . $name;
		
		if (('mapper' == $name) || !method_exists($this, $method)){
			throw new Exception('Invalid Activity property');
		}
		
		return $this->$method();
	}
	
	public function setOptions(array $options){
		$methods = get_class_methods($this);
		foreach($options as $key => $value){
			$method = 'set' . ucfirst($key);
			if(in_array($method, $methods)){
				$this->$method($value);
			}
		}
		return $this;
	}
		
	public function setActivityId($activityId){
		$this->_activityId = (int)$activityId;
		return $this;
	}
	
	public function getActivityId(){
		return $this->_activityId;
	}
		
	public function setUserName($userName){
		$this->_userName = (string)$userName;
		return $this;
	}	
	
	public function getUserName(){
		return $this->_userName;
	}
	
	public function setActivityDescription($activityDescription){
		$this->_activityDescription = (string)$activityDescription;
		return $this;
	}
	
	public function getActivityDescription(){
		return $this->_activityDescription;
	}
	
	public function setModuleName($moduleName){
		$this->_moduleName = (string)$moduleName;
		return $this;
	}
	
	public function getModuleName(){
		return $this->_moduleName;
	}
	
	public function setActivityDate($activityDate){
		$this->_activityDate = $activityDate;
		return $this;
	}
	
	public function getActivityDate(){
		return $this->_activityDate;
	}	
	
	public function setUserBrowser($userBrowser){
		$this->_userBrowser = (string)$userBrowser;
		return $this;
	}
	
	public function getUserBrowser(){
		return $this->_userBrowser;
	}	
	
	
	public function setUserIp($userIp){
		$this->_userIp = (string)$userIp;
		return $this;
	}
	
	public function getUserIp(){
		return $this->_userIp;
	}	
}
